import {Injectable} from '@angular/core';
import {HttpClientService} from '../../shared/services/http-client.service';
import {EntityService, enumAction} from '../../shared/services/entity.service';
import {UserPageConfig} from '../config/user.config';
import {StorageService} from '../../shared/services/storage.service';
import {AppContextService} from '../../shared/services/app-context.service';
import {BaseModel} from '../../shared/model/share.model';
import {UserDialogComponent} from '../component/user-dialog.component';
import {BaseDialogComponent} from '../../shared/component/base/base-dialog/base-dialog.component';

@Injectable()
export class UserService extends EntityService {
  test = 'userService';
  constructor(
    private app: AppContextService,
    private http: HttpClientService,
    private storage: StorageService
  ) {
    super(http, app, storage);
    this.pageData = UserPageConfig;
    this.dialog = {
      add: UserDialogComponent,
      edit: UserDialogComponent
    };
  }
  showAddDialog(item?: any) {
    this.app.showDialog({
      header: '新增用户1',
      width: '600',
      yes: (res) => {
        console.log(res);
      }}, this, this.dialog.add, item);
  }

  add(item?: any) {
    debugger;
    this.app.showDialog({
          header: '新增用户1',
          width: '600',
          yes: (res) => {
            console.log(res);
          }}, this, this.dialog.add, item);
  }
  edit() {

  }

}

export class UserSearch extends BaseModel {
  constructor() { super(); }

}
